package com.example.zg.zg_312_ordering_new.model;

import com.example.zg.zg_312_ordering_new.common.Constants;
import com.example.zg.zg_312_ordering_new.listener.RetrofitListener;
import com.example.zg.zg_312_ordering_new.services.PurchaseService;
import com.example.zg.zg_312_ordering_new.services.ShopService;

import retrofit2.Call;

public class ShopModel extends RetrofitBaseModel {
    private ShopService shopService;
    private PurchaseService purchaseService;
    public ShopModel(){
        this.shopService=retrofit.create(ShopService.class);
    }
    public void getAllShops(RetrofitListener listener){
        Call call=shopService.getAllShops();
        bindCallback(call,listener,Constants.GETALLSHOP);
    }
    public void insertOrder(int user_id,int food_id,int num,double sum,String suggesttime,String address,RetrofitListener listener){
        Call call=purchaseService.insertOrder(user_id,food_id,num,sum,suggesttime,address);
        bindCallback(call,listener,Constants.GETSHOPBYID);
    }
}
